<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="车辆名称" prop="field101">
        <el-input v-model="formData.field101" placeholder="请输入车辆名称" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="温度" prop="field103">
        <el-input v-model="formData.field103" placeholder="请输入温度" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="湿度" prop="field104">
        <el-input v-model="formData.field104" placeholder="请输入湿度" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="车辆速度" prop="field105">
        <el-input v-model="formData.field105" placeholder="请输入车辆速度" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field101: undefined,
        field103: undefined,
        field104: undefined,
        field105: undefined,
      },
      rules: {
        field101: [{
          required: true,
          message: '请输入车辆名称',
          trigger: 'blur'
        }],
        field103: [{
          required: true,
          message: '请输入温度',
          trigger: 'blur'
        }],
        field104: [{
          required: true,
          message: '请输入湿度',
          trigger: 'blur'
        }],
        field105: [{
          required: true,
          message: '请输入车辆速度',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
